<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <p:growl widgetVar="growl" showDetail="true" />
        <h:form>
            <h:panelGrid columns="2">
                <p:outputLabel for="summary" value="Summary: " /> 
                <p:inputText id="summary" value="#{testBean.summary}" required="true" />
                <p:outputLabel for="detail" value="Detail: " /> 
                <p:inputText id="detail" value="#{testBean.detail}" required="true" />
            </h:panelGrid>
            <p:commandButton value="Send" actionListener="#{testBean.send}" />
        </h:form>
        <p:socket onMessage="handleMessage" channel="/notifications" autoConnect="true" />

<script type="text/javascript">
function handleMessage(msg) { 
    alert("kkgjgj");
msg.severity = 'info';
PF('growl').show([msg]);
}
</script>
    </h:body>
</html>

